// 导入路由工具
import {createRouter,createWebHashHistory} from 'vue-router'

// 导入组件
import Layout from '../views/Layout.vue'
import Login from '../views/Login.vue'
import dataAnalysis from '@/views/home/dataAnalysis.vue'
import examArrange from '@/views/exam/examArrange.vue'
import courseUpload from '@/views/course/courseUpload.vue'
import courseClass from '@/views/course/courseCategory.vue'

import examManager from '@/views/exam/examManager.vue'
import myProject from '@/views/project/myproject.vue'
import createProject from '@/views/project/createproject.vue'

import RaceCom from '@/views/contest/RaceCom.vue'
import jobManager from '@/views/job/jobManager.vue'
import QuestionManagement from '@/views/question/QuestionManagement.vue'
import Type from '@/views/question/Type.vue'
import ImportExport from '@/views/question/ImportExport.vue'

import Teacher from '@/views/course/Teacher.vue'

import QuestionDifficulty from '@/views/question/QuestionDifficulty.vue'

import Addpage from '@/components/icons/add/Addpage.vue'


import ExamMoitor from '@/views/exam/ExamMoitor.vue'
import ExamAnalysis from '@/views/exam/examAnalysis/ExamAnalysis.vue'
import scoreAnalysis from '@/views/exam/scoreAnalysis.vue'

// 报表管理配置
import reportQuestion from '@/views/report/question.vue'
import reportExam from '@/views/report/exam.vue'
import reportCourse from '@/views/report/course.vue'

// 配置项目管理
import TotalProject from '@/views/project/myproject/totalProjet.vue'
import allProjectInfo from '@/views/project/myproject/allProjectInfo.vue'
import myManagerProject from '@/views/project/myproject/myManagerProject.vue'
import myCreateProjet from '@/views/project/myproject/myCreateProjet.vue'
// 配置系统管理
import userManager from '@/views/systemmanager/User.vue'
import StudentManager from '@/views/systemmanager/StudentManager.vue'
import TeacherManager from '@/views/systemmanager/TeacherManager.vue'


// 配置主键地址'

const routes = [
    {   
         path:'/login',
         component:Login
    },
    {
        path:'/',
        component:Layout,
        redirect:'/home/dataAnalysis',
        children:[
            {path:'home/dataAnalysis',component:dataAnalysis},
            {path:'exam/schedule',component:examArrange},
            {path:'/course/upload',component:courseUpload},
            {path:'/course/category',component:courseClass},
            {path:'/report/questionReport',component:reportQuestion},
            {path:'/report/examReport',component:reportExam},
            {path:'/report/courseReport',component:reportCourse},
            {path:'/systemmanager/user',component:userManager},
            {path:'/systemmanager/student',component:StudentManager},
            {path:'/systemmanager/teacher',component:TeacherManager},
            {
              path:'/project/myproject',
              component:myProject,
              redirect: '/project/myproject/all',
              children: [
                {path: '/project/myproject/all',component: TotalProject},
                {path: '/project/myproject/allProjectInfo',component: allProjectInfo},
                {path: '/project/myproject/myManagerProject',component: myManagerProject},
                {path: '/project/myproject/myCreateProjet',component: myCreateProjet}
              ]
            },
            {path:'/exam/manager',component:examManager},
            {path:'/project/createproject',component:createProject},
            {path:'/contest/RaceCom',component:RaceCom},
            {path:'/job/manager',component:jobManager},
            {path:"/question/management",component:QuestionManagement},
            {path:"/question/type",name: 'Type',component: Type},
            {path: '/question/difficulty',name: 'QuestionDifficulty',component:QuestionDifficulty },
            { path: '/question/import-export',name: 'ImportExport',component: ImportExport},
            {path:'/course/access',component:Teacher},
            {path:'/exam/monitor',component:ExamMoitor},
            {path:'/exam/examAnalysis/ExamAnalysis',component:ExamAnalysis},
            {path:'/exam/scoreAnalysis',component:scoreAnalysis},
            {
                path: '/add',
                name: 'add',
                component: () => import('../views/exam/AddView.vue'),
                redirect: '/add/addpage',
                children: [
                  {
                    path: '/add/addpage',
                    component: () => import('@/components/icons/add/Addpage.vue')
                  },
                  {
                    path: '/add/addpagefirst',
                    component: () => import('@/components/icons/add/AddpageFirst.vue')
                  },
                  {
                    path: '/add/addpagesecond',
                    component: () => import('@/components/icons/add/AddpageSecond.vue')
                  }
                ]
            }
          ]
    }
]

// 配置路由访问地址方式
const router = createRouter({
    history:createWebHashHistory(import.meta.env.BASE_URL),
    routes:routes
})  


// 对外暴露路由
export default router
